package com.yc.cloud.openai.portal.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum ImageRecordStatusEnums {
    PROGRESS("2", "处理中"),
    //写实人物风格
    FINISHED("1", "已完成"),
    PENDING("0", "排队中"),
    CANCELLED("3", "已取消");

    private final String key;
    private final String value;

    ImageRecordStatusEnums(String key, String value) {
        this.key = key;
        this.value = value;
    }


    public static ImageRecordStatusEnums fromKey(String key) {
        for (ImageRecordStatusEnums provider : ImageRecordStatusEnums.values()) {
            if (Objects.equals(provider.getKey(), key)) {
                return provider;
            }
        }
        throw new IllegalArgumentException("Unknown key: " + key);
    }
}
